<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<ecp:header noCache="true" style="themes/default/style/style.css,themes/default/style/blueprint/screen.css"/>	
		
<%-- 	<link href="${ctx}/themes/default/style/blueprint/screen.css" type="text/css" rel="stylesheet" media="screen, projection"/> --%>
<%-- 	<link href="${ctx}/themes/default/style/blueprint/print.css" type="text/css" rel="stylesheet" media="print"/> --%>
	<!--[if lt IE 8]><link href="${ctx}/css/blueprint/blueprint/ie.css" type="text/css" rel="stylesheet" media="screen, projection"><![endif]-->

	
	<script type="text/javascript">

		function loginSubmit(){
			
			var loginFrom = $('#loginForm').serializeArray(); 
			$.ajax({
			    url: '${ctx}/login.do',
			    success: function(json){
			        
			        if(json == 'ok'){
			        	var scrWidth=screen.availWidth;
			            var scrHeight=screen.availHeight - 20;
			        	window.open('main.do','maxwindow','alwaysRaised=yes,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,status=yes,width='+scrWidth+',height='+scrHeight);   
			        	opener=null;//没有这句，关闭时有提示,ie6以上有效   
			        	window.open("","_self");//没有这句，关闭时有提示,ie7以上有效  
						window.close();
			        }else{
			        	alert( json );
			        }
			    },
				error: function(){
					alert('error');
				}
			});
		}
	</script>
</head>
<body>
<div class="container">
<div id="header" class="span-24 last">
	<div id="title">
		<h2>Mini-Web示例</h2>
		<h3>--CRUD管理界面演示</h3>
	</div>
	<div id="menu">
		<ul>
			<li><a href="${ctx}/account/user.action">帐号列表</a></li>
			<li><a href="${ctx}/account/role.action">角色列表</a></li>
			<li><a href="${ctx}/login!logout.action">退出登录</a></li>
		</ul>
	</div>
</div>
<div id="content">
	<div class="span-24 last">

	<form id="loginForm" name="loginForm" action="" method="post" style="margin-top:1em">
		<table class="noborder">
			<tr>
				<td><label for="account">登陆账号:</label><input type='text' id='account' name='account' class="required" value="${account}" />
				
				</td>
			</tr>
			<tr>
				<td><label for="password">登录密码:</label><input type='password' id='password' name='password' class="required" value="${password}"/>
				
				</td>
			</tr>
			<tr>
				<td align="right">
					<input type="checkbox" id="rememberAccount" name="rememberAccount" <c:if test="${rememberAccount != null }">checked</c:if> />
					<label for="rememberMe">记住账号</label>
				
					<input type="checkbox" id="rememberPassword" name="rememberPassword" <c:if test="${rememberPassword != null }">checked</c:if> />
					<label for="rememberMe">记住密码</label>
				</td>
			</tr>
			<tr>
				<td align="right">
					<input id="loginButton" value="登录" type="button" onclick="loginSubmit();" class="button"/>
				</td>
			</tr>
		</table>
	</form>
	<div>(管理员<b>admin/admin</b>, 普通用户<b>user/user</b>)</div>
	</div>
</div>
<%@ include file="/common/footer.jsp" %>
</div>
</body>
</html>

